package cn.jinjimi.app.webview.bean;

import com.google.gson.annotations.SerializedName;

import cn.jinjimi.app.webview.AbstractJavascriptBridge;
import cn.jinjimi.framework.pay.IPay;
import cn.jinjimi.framework.pay.PayOrder;

/**
 * @author zhenhua
 * @date 2018/4/8
 */
public class WXPayOrder extends AbstractJavascriptBridge.BaseAction {
    /**
     * 商户ID
     */
    @SerializedName("partnerId")
    public String partnerId;

    /**
     * 预付单号
     */
    @SerializedName("prepayId")
    public String prepayId;

    /**
     * default is apk package name
     */
    @SerializedName("package")
    public String packageValue;

    /**
     * 随机字符串
     */
    @SerializedName(value = "nonceStr", alternate = {"noncestr"})
    public String nonceStr;

    /**
     * 订单时间戳
     */
    @SerializedName(value = "timeStamp", alternate = {"timestamp"})
    public String timeStamp;

    /**
     * 签名
     */
    public String sign;

    public WXPayOrder() {

    }

    public PayOrder toPayOrder() {
        PayOrder.WXPayOrderExt order = new PayOrder.WXPayOrderExt();
        order.bizType = IPay.BIZ_TYPE_PRODUCT;
        order.nonceStr = nonceStr;
        order.partnerId = partnerId;
        order.packageValue = packageValue;
        order.prepayId = prepayId;
        order.timeStamp = timeStamp;
        order.sign = sign;
        return order;
    }
}
